\hypertarget{vector_8c}{}\doxysubsection{extern/libembroidery/src/geometry/vector.c File Reference}
\label{vector_8c}\index{extern/libembroidery/src/geometry/vector.c@{extern/libembroidery/src/geometry/vector.c}}
{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$stdlib.\+h$>$}\newline
{\ttfamily \#include $<$math.\+h$>$}\newline
{\ttfamily \#include \char`\"{}../embroidery.\+h\char`\"{}}\newline
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{vector_8c_aaad72d90c58592e330de08139aee5077}{emb\+Vector\+\_\+normalize}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} vector, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} $\ast$result)
\item 
void \mbox{\hyperlink{vector_8c_a0a4af07bfac410623cf77a35a11550b1}{emb\+Vector\+\_\+multiply}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} vector, \mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} magnitude, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} $\ast$result)
\item 
\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} \mbox{\hyperlink{vector_8c_a338eacec372464c0c336e26a5586b3e9}{emb\+Vector\+\_\+add}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} a, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} b)
\item 
\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} \mbox{\hyperlink{vector_8c_aecc78c302ab283c53ce99697008766d0}{emb\+Vector\+\_\+average}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} a, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} b)
\item 
\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} \mbox{\hyperlink{vector_8c_a55514b10c8ae6869e9889d770f515882}{emb\+Vector\+\_\+subtract}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} v1, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} v2)
\item 
\mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} \mbox{\hyperlink{vector_8c_a5eb0184af5d76ee1369f5019e61c27be}{emb\+Vector\+\_\+dot}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} a, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} b)
\item 
\mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} \mbox{\hyperlink{vector_8c_ac763a1a571c5cb36a99bf73e31ee6919}{emb\+Vector\+\_\+cross}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} a, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} b)
\begin{DoxyCompactList}\small\item\em The \char`\"{}cross product\char`\"{} as vectors {\itshape a} and {\itshape b} returned as a real value. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{vector_8c_acb7c080f09a460062df3d4f9aa2693be}{emb\+Vector\+\_\+transpose\+\_\+product}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} v1, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} v2, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} $\ast$result)
\item 
\mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} \mbox{\hyperlink{vector_8c_a96123840be79cee1c9857c7f47e772f2}{emb\+Vector\+\_\+length}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} vector)
\item 
\mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} \mbox{\hyperlink{vector_8c_a0823dd7ae47773dea4dc396f895fc198}{emb\+Vector\+\_\+relativeX}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} a1, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} a2, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} a3)
\item 
\mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} \mbox{\hyperlink{vector_8c_a8ba74d18e7d36b8340cb9149144d4ea1}{emb\+Vector\+\_\+relativeY}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} a1, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} a2, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} a3)
\item 
\mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} \mbox{\hyperlink{vector_8c_a2d40fb11eee627cc40fa0e0b8b0bbcb9}{emb\+Vector\+\_\+angle}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} v)
\item 
\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} \mbox{\hyperlink{vector_8c_a375a523c9d7cba12f3ac30d990868a7a}{emb\+Vector\+\_\+unit}} (\mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} alpha)
\item 
\mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} \mbox{\hyperlink{vector_8c_abdedf2d469e6f9f4dc6d530086c3aa11}{emb\+Vector\+\_\+distance}} (\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} a, \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} b)
\end{DoxyCompactItemize}


\doxysubsubsection{Function Documentation}
\mbox{\Hypertarget{vector_8c_a338eacec372464c0c336e26a5586b3e9}\label{vector_8c_a338eacec372464c0c336e26a5586b3e9}} 
\index{vector.c@{vector.c}!embVector\_add@{embVector\_add}}
\index{embVector\_add@{embVector\_add}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_add()}{embVector\_add()}}
{\footnotesize\ttfamily \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} emb\+Vector\+\_\+add (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{a,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{b }\end{DoxyParamCaption})}

The sum of vectors {\itshape a} and {\itshape b} returned as a vector.

Equivalent to\+:

\[
      \mathbf{c} = \mathbf{a} + \mathbf{b}
                 = \begin{pmatrix} a_{x} + b_{x} \\ a_{y}+b_{y} \end{pmatrix}
\] \mbox{\Hypertarget{vector_8c_a2d40fb11eee627cc40fa0e0b8b0bbcb9}\label{vector_8c_a2d40fb11eee627cc40fa0e0b8b0bbcb9}} 
\index{vector.c@{vector.c}!embVector\_angle@{embVector\_angle}}
\index{embVector\_angle@{embVector\_angle}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_angle()}{embVector\_angle()}}
{\footnotesize\ttfamily \mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} emb\+Vector\+\_\+angle (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{v }\end{DoxyParamCaption})}

The angle, measured anti-\/clockwise from the x-\/axis, of a vector v. \mbox{\Hypertarget{vector_8c_aecc78c302ab283c53ce99697008766d0}\label{vector_8c_aecc78c302ab283c53ce99697008766d0}} 
\index{vector.c@{vector.c}!embVector\_average@{embVector\_average}}
\index{embVector\_average@{embVector\_average}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_average()}{embVector\_average()}}
{\footnotesize\ttfamily \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} emb\+Vector\+\_\+average (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{a,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{b }\end{DoxyParamCaption})}

The average of vectors {\itshape v1} and {\itshape v2} returned as a vector.

Equivalent to\+:

\[
      \mathbf{c} = \frac{\mathbf{a} + \mathbf{b}}{2}
                 = \begin{pmatrix} \frac{a_{x} + b_{x}}{2} \\ \frac{a_{y}+b_{y}}{2} \end{pmatrix}
\] \mbox{\Hypertarget{vector_8c_ac763a1a571c5cb36a99bf73e31ee6919}\label{vector_8c_ac763a1a571c5cb36a99bf73e31ee6919}} 
\index{vector.c@{vector.c}!embVector\_cross@{embVector\_cross}}
\index{embVector\_cross@{embVector\_cross}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_cross()}{embVector\_cross()}}
{\footnotesize\ttfamily \mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} emb\+Vector\+\_\+cross (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{a,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{b }\end{DoxyParamCaption})}



The \char`\"{}cross product\char`\"{} as vectors {\itshape a} and {\itshape b} returned as a real value. 

Technically, this is the magnitude of the cross product when the embroidery is placed in the z=0 plane (since the cross product is defined for 3-\/dimensional vectors). That is\+:

\[
      |c| = \left| \begin{pmatrix} a_x \\ a_y \\ 0 \end{pmatrix} \times \begin{pmatrix} b_x \\ b_y \\ 0 \end{pmatrix}\right|
          = \left| \begin{pmatrix} 0 \\ 0 \\ a_x b_y - a_y b_x \end{pmatrix} \right|
          = a_x b_y - a_y b_x
\] \mbox{\Hypertarget{vector_8c_abdedf2d469e6f9f4dc6d530086c3aa11}\label{vector_8c_abdedf2d469e6f9f4dc6d530086c3aa11}} 
\index{vector.c@{vector.c}!embVector\_distance@{embVector\_distance}}
\index{embVector\_distance@{embVector\_distance}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_distance()}{embVector\_distance()}}
{\footnotesize\ttfamily \mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} emb\+Vector\+\_\+distance (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{a,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{b }\end{DoxyParamCaption})}

The distance between {\itshape a} and {\itshape b} returned as a real value.

\[
     d = \left|\mathbf{a}-\mathbf{b}\right|
       = \sqrt{(a_x-b_x)^{2} + (a_y-b_y)^{2}}
\] \mbox{\Hypertarget{vector_8c_a5eb0184af5d76ee1369f5019e61c27be}\label{vector_8c_a5eb0184af5d76ee1369f5019e61c27be}} 
\index{vector.c@{vector.c}!embVector\_dot@{embVector\_dot}}
\index{embVector\_dot@{embVector\_dot}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_dot()}{embVector\_dot()}}
{\footnotesize\ttfamily \mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} emb\+Vector\+\_\+dot (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{a,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{b }\end{DoxyParamCaption})}

The dot product as vectors {\itshape v1} and {\itshape v2} returned as a Emb\+Real.

Equivalent to\+:

\[
      c = \mathbf{a} \cdot \mathbf{b}
        = a_x b_x + a_y b_y
\] \mbox{\Hypertarget{vector_8c_a96123840be79cee1c9857c7f47e772f2}\label{vector_8c_a96123840be79cee1c9857c7f47e772f2}} 
\index{vector.c@{vector.c}!embVector\_length@{embVector\_length}}
\index{embVector\_length@{embVector\_length}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_length()}{embVector\_length()}}
{\footnotesize\ttfamily \mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} emb\+Vector\+\_\+length (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{vector }\end{DoxyParamCaption})}

The length or absolute value of the vector {\itshape vector}.

Equivalent to\+:

\[
      |v| = \sqrt{v_{x}^{2} + v_{y}^{2}}
\] \mbox{\Hypertarget{vector_8c_a0a4af07bfac410623cf77a35a11550b1}\label{vector_8c_a0a4af07bfac410623cf77a35a11550b1}} 
\index{vector.c@{vector.c}!embVector\_multiply@{embVector\_multiply}}
\index{embVector\_multiply@{embVector\_multiply}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_multiply()}{embVector\_multiply()}}
{\footnotesize\ttfamily void emb\+Vector\+\_\+multiply (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{vector,  }\item[{\mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}}}]{magnitude,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} $\ast$}]{result }\end{DoxyParamCaption})}

The scalar multiple {\itshape magnitude} of a vector {\itshape vector}. Returned as {\itshape result}.

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000240}{Todo}}]make result return argument. \end{DoxyRefDesc}
\mbox{\Hypertarget{vector_8c_aaad72d90c58592e330de08139aee5077}\label{vector_8c_aaad72d90c58592e330de08139aee5077}} 
\index{vector.c@{vector.c}!embVector\_normalize@{embVector\_normalize}}
\index{embVector\_normalize@{embVector\_normalize}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_normalize()}{embVector\_normalize()}}
{\footnotesize\ttfamily void emb\+Vector\+\_\+normalize (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{vector,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} $\ast$}]{result }\end{DoxyParamCaption})}

Finds the unit length vector {\itshape result} in the same direction as {\itshape vector}.

Equivalent to\+:

\[
      \mathbf{u} = \frac{v}{|\mathbf{v}|}
\]

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000239}{Todo}}]make result return argument. \end{DoxyRefDesc}
\mbox{\Hypertarget{vector_8c_a0823dd7ae47773dea4dc396f895fc198}\label{vector_8c_a0823dd7ae47773dea4dc396f895fc198}} 
\index{vector.c@{vector.c}!embVector\_relativeX@{embVector\_relativeX}}
\index{embVector\_relativeX@{embVector\_relativeX}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_relativeX()}{embVector\_relativeX()}}
{\footnotesize\ttfamily \mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} emb\+Vector\+\_\+relativeX (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{a1,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{a2,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{a3 }\end{DoxyParamCaption})}

The x-\/component of the vector \mbox{\Hypertarget{vector_8c_a8ba74d18e7d36b8340cb9149144d4ea1}\label{vector_8c_a8ba74d18e7d36b8340cb9149144d4ea1}} 
\index{vector.c@{vector.c}!embVector\_relativeY@{embVector\_relativeY}}
\index{embVector\_relativeY@{embVector\_relativeY}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_relativeY()}{embVector\_relativeY()}}
{\footnotesize\ttfamily \mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}} emb\+Vector\+\_\+relativeY (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{a1,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{a2,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{a3 }\end{DoxyParamCaption})}

The y-\/component of the vector \mbox{\Hypertarget{vector_8c_a55514b10c8ae6869e9889d770f515882}\label{vector_8c_a55514b10c8ae6869e9889d770f515882}} 
\index{vector.c@{vector.c}!embVector\_subtract@{embVector\_subtract}}
\index{embVector\_subtract@{embVector\_subtract}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_subtract()}{embVector\_subtract()}}
{\footnotesize\ttfamily \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} emb\+Vector\+\_\+subtract (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{v1,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{v2 }\end{DoxyParamCaption})}

The difference between vectors {\itshape v1} and {\itshape v2} returned as {\itshape result}.

Equivalent to\+:

\[
      \mathbf{c} = \mathbf{a} - \mathbf{b}
                 = \begin{pmatrix} a_{x} - b_{x} \\ a_{y}-b_{y} \end{pmatrix}
\] \mbox{\Hypertarget{vector_8c_acb7c080f09a460062df3d4f9aa2693be}\label{vector_8c_acb7c080f09a460062df3d4f9aa2693be}} 
\index{vector.c@{vector.c}!embVector\_transpose\_product@{embVector\_transpose\_product}}
\index{embVector\_transpose\_product@{embVector\_transpose\_product}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_transpose\_product()}{embVector\_transpose\_product()}}
{\footnotesize\ttfamily void emb\+Vector\+\_\+transpose\+\_\+product (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{v1,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}}}]{v2,  }\item[{\mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} $\ast$}]{result }\end{DoxyParamCaption})}

Since we aren\textquotesingle{}t using full vector algebra here, all vectors are \char`\"{}vertical\char`\"{}. so this is like the product v1$^\wedge$\{T\} I\+\_\+\{2\} v2 for our vectors {\itshape v1} and \textbackslash{}v2 so a \char`\"{}component-\/wise product\char`\"{}. The result is stored at the pointer {\itshape result}.

That is (1 0) (a) = (xa) (x y)(0 1) (b) (yb) \mbox{\Hypertarget{vector_8c_a375a523c9d7cba12f3ac30d990868a7a}\label{vector_8c_a375a523c9d7cba12f3ac30d990868a7a}} 
\index{vector.c@{vector.c}!embVector\_unit@{embVector\_unit}}
\index{embVector\_unit@{embVector\_unit}!vector.c@{vector.c}}
\doxyparagraph{\texorpdfstring{embVector\_unit()}{embVector\_unit()}}
{\footnotesize\ttfamily \mbox{\hyperlink{embroidery_8h_a16fa26764453571074cb85a7574738d4}{Emb\+Vector}} emb\+Vector\+\_\+unit (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{embroidery_8h_a2082be9aabfb541dff1825c4ca6a05cd}{Emb\+Real}}}]{alpha }\end{DoxyParamCaption})}

The unit vector in the direction {\itshape angle}.

\[
      \mathbf{a}_{\alpha} = \begin{pmatrix} \cos(\alpha) \\ \sin(\alpha) \end{pmatrix}
\] 